package com.ruoyi;

import com.ruoyi.app.service.InviteCodePool;
import com.ruoyi.app.service.ResetUserInviteCode;
import com.ruoyi.bizsys.service.IAppUserService;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.Func;
import com.ruoyi.common.utils.StringRandomUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;

import java.util.HashSet;
import java.util.Set;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@Slf4j
@EnableWebSecurity
@EnableRetry
@MapperScan("com.ruoyi.*.mapper")
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class LcreditPdlApplication implements CommandLineRunner {


    @Autowired
    private InviteCodePool inviteCodePool;

    @Autowired
    private ResetUserInviteCode resetUserInviteCode;


    public static void main(String[] args) {
        System.setProperty("spring.devtools.restart.enabled", "true");
        SpringApplication.run(LcreditPdlApplication.class, args);
        log.info("(♥◠‿◠)ﾉﾞ  LinkCredit start successfully   ლ(´ڡ`ლ)ﾞ  \n");
//                " .-------.       ____     __        \n" +
//                " |  _ _   \\      \\   \\   /  /    \n" +
//                " | ( ' )  |       \\  _. /  '       \n" +
//                " |(_ o _) /        _( )_ .'         \n" +
//                " | (_,_).' __  ___(_ o _)'          \n" +
//                " |  |\\ \\  |  ||   |(_,_)'         \n" +
//                " |  | \\ `'   /|   `-'  /           \n" +
//                " |  |  \\    /  \\      /           \n" +
//                " ''-'   `'-'    `-..-'              ");
    }


    @Override
    public void run(String... args) {
//        log.info("初始化...");
//
//        Long initialization = inviteCodePool.initialization();
//        log.info("Redis initialization Size:{}.",initialization);
//        if (initialization > 0){
//            resetUserInviteCode.initialization();
//        }
//
//        log.info("The initialization task complete.");
    }


}
